<template>
  <div>
    <!-- 使用Header组件 -->
    <HeaderComponent 
      :isLoggedIn="userStore.isLoggedIn"
      :userInfo="userStore.userInfo"
      :showUserPanel="showUserPanel"
      @toggle-user-panel="toggleUserPanel"
      @logout="handleLogout"
    />
    
    <div class="content-notes-page">
      <div class="page-header">
        <h1 class="page-title">内容笔记</h1>
        <p class="page-subtitle">管理您的学习笔记和内容收藏</p>
      </div>
      
      <div class="notes-container">
        <div class="notes-tabs">
          <div class="tab-item active">我的笔记</div>
          <div class="tab-item">收藏内容</div>
          <div class="tab-item">学习计划</div>
        </div>
        
        <div class="notes-content">
          <div class="empty-state">
            <div class="empty-icon">📝</div>
            <div class="empty-text">暂无笔记内容</div>
            <div class="empty-subtext">开始记录您的学习心得和重要内容吧！</div>
            <button class="create-note-btn">创建笔记</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import HeaderComponent from '@/components/HeaderComponent.vue'
import { useUserStore } from '@/stores/user.js'

export default {
  name: 'ContentNotes',
  components: {
    HeaderComponent
  },
  setup() {
    const userStore = useUserStore();
    return {
      userStore
    }
  },
  data() {
    return {
      showUserPanel: false
    }
  },
  methods: {
    toggleUserPanel() {
      this.showUserPanel = !this.showUserPanel;
    },
    handleLogout() {
      this.userStore.logout();
      this.$router.push('/');
    }
  }
}
</script>

<style scoped>
.content-notes-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f4f5f5;
  min-height: 100vh;
}

.page-header {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.page-title {
  font-size: 28px;
  font-weight: bold;
  color: #1d2129;
  margin: 0 0 8px 0;
}

.page-subtitle {
  font-size: 16px;
  color: #86909c;
  margin: 0;
}

.notes-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.notes-tabs {
  display: flex;
  border-bottom: 1px solid #e4e6eb;
  padding: 0 24px;
}

.tab-item {
  padding: 16px 20px;
  cursor: pointer;
  color: #86909c;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-item.active {
  color: #1e80ff;
  border-bottom-color: #1e80ff;
}

.tab-item:hover {
  color: #1e80ff;
}

.notes-content {
  padding: 40px 24px;
}

.empty-state {
  text-align: center;
  padding: 60px 0;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-text {
  font-size: 18px;
  color: #1d2129;
  margin-bottom: 8px;
  font-weight: 500;
}

.empty-subtext {
  font-size: 14px;
  color: #86909c;
  margin-bottom: 24px;
}

.create-note-btn {
  background: #1e80ff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.create-note-btn:hover {
  background: #1664cc;
}
</style>